10. Deploying to iOS
Deploying to iOS
Apple ID
To get started deploying your first VR app on to your iOS device, navigate to the Apple ID website and create a free account.

Note: You will not be able to publish apps to the store unless you pay Apple's yearly fee, but you can still test on your personal device.
Xcode Setup
Note: You should already have downloaded and installed Xcode during the Before You Get Started > Installation lesson.
Go ahead and open Xcode. In the Xcode menu, select Xcode > Preferences… to open up the preferences window. In the popup, select Accounts to display information about the Apple IDs that have been added to Xcode.
Click the plus sign in the bottom-left corner, choose Add Apple ID…, enter the e-mail and password for the account you created, and click the Sign In button:

With that, Xcode should be all set up and ready to use.
Unity Setup
Build Settings
Let’s now hop into Unity. Once you have your Unity project loaded, in the Unity menu, go to File > Build Settings… to open up the Builds Settings popup window:

In the Platform list, select iOS, then the Switch Platform button. This process may take a few minute as Unity will need to reimport all the assets and prepare them for the iOS platform.
Player Settings
The last step to check is the Player Settings. You can access these settings in the Unity menu Edit > Project Settings > Player or by clicking the Player Settings… button in the Builds Settings popup window. This will bring up a lot of settings in the Inspector:

In this starter project, we have prepared the settings for you. However, because this now is your project, you will want to modify the Company Name and Bundle Identifier with your own information:
- Company Name:
Firstname Lastname - Bundle Identifier:
com.firstnamelastname.udacitycarnival
Note: Leaving the pre-filled Bundle Identifier,
com.udacity.udacitycarnival, unchanged might prevent you from deploying the project to your iOS device.
Build and Run
Now we are ready to deploy. In the Builds Settings popup window, click the Build and Run button:

When you click the Build and Run button, Unity will prompt you for a location to save the Xcode project. Let’s create a new empty folder named Builds. We recommend placing this folder at the repo level, i.e. the parent folder of your Unity project.
Note: It's also common to place the Builds folder in the Unity project folder, i.e. at the same level as the Assets folder.
Give the Xcode project a descriptive name and click the Save button:

Note: Never place your builds inside any of the Unity generated folders such as Assets, Library, ProjectSettings, etc., as this can break your project.
Unity will now create the build, i.e. the Xcode project, and open it in Xcode. Once this process is complete, you can close Unity. Then, in Xcode's Project Navigator, located in the left sidebar, click on Unity-iPhone, and change the Team from None to your Apple ID:

When you do that, the red error message should disappear.
Note: You can ignore any yellow warnings you see.
Deploy to the iPhone
If you haven't already, connect your iPhone to your Mac with a USB cable, select it in Xcode, and click the Play button:

If this is the first time deploying to this iPhone, you will see a few popups in Xcode including a prompt to Verify the Developer App certificate. Simply follow the instuctions in the popup:

Once you have updated those settings on your iPhone, you can click the Play button again and and Xcode will launch the app on your iPhone.
Opening an Existing Xcode Project
If for any reason you need to open up your Xcode project without launching it from Unity, make sure you open the .xcworkspace and not the .xcodeproj file:
